<template>
<!--公司资料页面 => 参与的社区组件-->
<div class="join_community">
	<div class="title">
		{{ $lang('JOIN_COMMUNCITY') }}
		<!-- <div class="sort">
			<img src="../../assets/img/sort.png" alt="排序" ><span>{{ sortName }}</span>
		</div> -->
	</div>
	<el-table
    :data="Participating.data"
    style="width: 100%;border:10px;background-color: #212C4F;"
  	:row-style="{
  		'border':'none',
  		'background-color':'#1D2748',
  		'border-bottom':'none',
  		'text-align':'center',
  	}"	
  	>
    <el-table-column
      prop="companyId"
      :label="$lang('SERIAL_NUMBER')"
      type="index"
      width="240">
    </el-table-column>
    <el-table-column
      prop="walletAddress"
      :label="$lang('WALLET_ADDRESS')"
      width="240">
    </el-table-column>
    <el-table-column
      prop="participationRatio"
      :label="$lang('VOTE_PERCENT')"
      width="240">
       <template scope='scope' >{{ scope.row.participationRatio }}%</template>
    </el-table-column>
    <el-table-column
      prop="investmentAmount"
      :label="$lang('INVEST_MONEY')"
      width="200">
    </el-table-column>
    <el-table-column
      prop="netProfitOfInvestedCompany"
      :label="$lang('INVEST_COMPANY_NET_PROFIT')"
      width="280">
    </el-table-column>
  </el-table>
  <el-pagination
    layout="prev, pager, next"
    @current-change="getParticipating"
    :total="Participating.totalPage*10">
  </el-pagination>
</div>
</template>

<script>
import { gets } from "@/api/api.js";
export default {
	data() {
		return {
			input :"",
            sortName: "升序",
            Participating: []
		}
    },
    methods:{
        async getParticipating(type) {
            let that = this
            try {
                let res = await gets.searchCompanyList("/community/find-participating-community.json", {
                    companyId : that.$store.state.common.companyId,
                    pageNo: type,
                    pageSize : 5
                });
                
                that.Participating = res.data
            } catch (e) {
                console.log(e)
                throw e;
            }
        }
	},
	components:{
    },
    created() {
        this.getParticipating(1)
    },
}
</script>

<style>
</style>